class TransactionItemM {
  TransactionItemM({
      this.id, 
      this.targetId, 
      this.targetContent, 
      this.amount, 
      this.giftAmount, 
      this.totalAmount, 
      this.balance, 
      this.fee, 
      this.topic, 
      this.content, 
      this.type, 
      this.paymentType, 
      this.inOrOut, 
      this.subStatus, 
      this.status, 
      this.createTime,
      this.errorMsg,
  });

  TransactionItemM.fromJson(dynamic json) {
    id = json['id'];
    targetId = json['target_id'];
    targetContent = json['target_content'];
    amount = json['amount'];
    giftAmount = json['gift_amount'];
    totalAmount = json['total_amount'];
    balance = json['balance'];
    fee = json['fee'];
    topic = json['topic'];
    content = json['content'];
    type = json['type'];
    paymentType = json['payment_type'];
    inOrOut = json['in_or_out'];
    subStatus = json['sub_status'];
    status = json['status'];
    createTime = json['create_time'];
  }
  String? id;
  String? targetId;
  String? targetContent;
  num? amount;
  num? giftAmount;
  num? totalAmount;
  num? balance;
  num? fee;
  String? topic;
  String? content;
  num? type;
  num? paymentType;
  num? inOrOut;
  num? subStatus;
  num? status;
  num? createTime;
  String? errorMsg;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = id;
    map['target_id'] = targetId;
    map['target_content'] = targetContent;
    map['amount'] = amount;
    map['gift_amount'] = giftAmount;
    map['total_amount'] = totalAmount;
    map['balance'] = balance;
    map['fee'] = fee;
    map['topic'] = topic;
    map['content'] = content;
    map['type'] = type;
    map['payment_type'] = paymentType;
    map['in_or_out'] = inOrOut;
    map['sub_status'] = subStatus;
    map['status'] = status;
    map['create_time'] = createTime;
    return map;
  }

  factory TransactionItemM.error(String error){
    return TransactionItemM(errorMsg: error.replaceAll('Exception', ''));
  }

}